﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using PSE.Framework.Configuration;

namespace PSE.Framework.UI.Application.SmartClient.Configuration
{
    /// <summary>
    /// Seção para configuração dos idiomas da aplicação
    /// </summary>
    public class LanguagesConfigurationSection : ConfigurationSection
    {
        public LanguagesConfigurationSection()
        {
        }

        /// <summary>
        /// Idioma default do sistema
        /// </summary>
        [ConfigurationProperty("defaultLanguage", IsRequired=true)]
        public string DefaultLanguage
        {
            get
            {
                return (string)this["defaultLanguage"];
            }
            set
            {
                this["defaultLanguage"] = value;
            }
        }

        /// <summary>
        /// Idiomas instalados no sistema
        /// </summary>
        [ConfigurationProperty("installedLanguages", IsRequired=true, IsDefaultCollection = true)]
        [ConfigurationCollection(typeof(LanguageElement), AddItemName = "language")]
        public ConfigurationCollection<LanguageElement> InstalledLanguages
        {
            get
            {
                return (ConfigurationCollection<LanguageElement>)this["installedLanguages"];
            }
        }
    }
}
